//
//  IntroduceViewController.m
//  e律师
//
//  Created by 韦淋 on 2017/5/19.
//  Copyright © 2017年 test. All rights reserved.
//

#import "IntroduceViewController.h"




@interface IntroduceViewController ()<JHPickerDelegate,UITextFieldDelegate,UITextViewDelegate>
{
    BOOL isHaveDian;
}
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *imageArray;
@property (nonatomic, strong) NSArray *placeHolderArray;
@property (nonatomic, strong) NSArray *starArray;
@property (nonatomic, strong) NSDictionary *log_Type;
@property (nonatomic, strong) NSDictionary *charge_Type;
@property (nonatomic, strong) NSDictionary *pay_Type;
@property (nonatomic, strong) NSDictionary *tollMethod;
@property (nonatomic, strong) NSDictionary *ssjdDic;
@property (nonatomic, strong) NSDictionary *ssdwDic;
@property (nonatomic, strong) NSDictionary *postDic;
@property (nonatomic, strong) NSMutableArray *dataSource;
@property (nonatomic, assign) NSString *selectStr;
@property (nonatomic, assign) NSInteger seletTag;
@end

@implementation IntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = false;
    NSLog(@"caseDetailDic = %@",self.caseDetailDic);
    self.dataSource = [NSMutableArray array];
    self.postDic = [NSDictionary dictionary];
    self.barTitleLable.text = @"编辑";
    self.view.backgroundColor = [UIColor whiteColor];
    [self initUI];
}
#pragma mark - Private Method

- (void)initUI{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    
    
    scrollView.delegate = self;
    [self.view insertSubview:scrollView atIndex:0];
    
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT * 2)];
    backView.backgroundColor = [UIColor whiteColor];
    [scrollView addSubview:backView];
    
    
    
    
    UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 70, self.view.bounds.size.width - 20, 40)];
    bgView.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
    
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 30, 30)];
    //    imageView.backgroundColor = [UIColor redColor];
    imageView.image = [UIImage imageNamed:@"llist_00"];
    
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, self.view.bounds.size.width, 40)];
    lable.text = self.caseTypeStr;
    lable.textColor = [UIColor blackColor];
    
    [backView addSubview:bgView];
    [bgView addSubview:lable];
    [bgView addSubview:imageView];
    
    
    for (int i = 0; i < self.titleArray.count; i ++) {
        
        
        UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 120 + i * 50, self.view.bounds.size.width - 20, 40)];
        bgView.backgroundColor = [UIColor whiteColor];
        bgView.layer.borderWidth = 1.0f;
        bgView.layer.borderColor = [[UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f] CGColor];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0, 40, 40)];
        view.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        
        UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 90, 40)];
        titleLable.textColor = [UIColor blackColor];
        titleLable.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        titleLable.font = [UIFont systemFontOfSize:13];
        titleLable.text = self.titleArray[i];
        
        UILabel *redStar = [[UILabel alloc] initWithFrame:CGRectMake(130, 0, 10, 40)];
        redStar.textColor = [UIColor redColor];
        redStar.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        redStar.font = [UIFont systemFontOfSize:13];
        redStar.text = self.starArray[i];
        
        [backView addSubview:bgView];
        
        [bgView addSubview:titleLable];
        [bgView addSubview:redStar];
        
        UITextField *inputInfo = [[UITextField alloc] initWithFrame:CGRectMake(160, 120 + i * 50, 200, 40)];
        inputInfo.clearButtonMode = UITextFieldViewModeWhileEditing;
        inputInfo.textAlignment = NSTextAlignmentLeft;
        inputInfo.font = [UIFont systemFontOfSize:13];
        inputInfo.placeholder = self.placeHolderArray[i];
        inputInfo.delegate = self;
        
        UIButton *button_textFiled = [[UIButton alloc] initWithFrame:CGRectMake(160, 120 + i * 50, 200, 40)];
        [button_textFiled addTarget:self action:@selector(textFieldsDidClick:) forControlEvents:(UIControlEventTouchUpInside)];
        
        
        
        
        
        if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
            scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT + 250);
            inputInfo.tag = i + 100;
            button_textFiled.tag = i + 100;
            if (i == 0) {
                inputInfo.text = self.caseDetailDic[@"sarq"];
            }
            if (i == 1) {
                inputInfo.text = self.caseDetailDic[@"ay"];
            }
            if (i == 2) {
                inputInfo.text = self.caseDetailDic[@"wtr"];
            }
            if (i == 3) {
                inputInfo.text = self.caseDetailDic[@"tel"];
            }
            if (i == 4) {
                inputInfo.text = self.caseDetailDic[@"dsr"];
            }
            if (i == 5) {
                inputInfo.text = self.caseDetailDic[@"dfdsr"];
            }
            if (i == 6) {
                inputInfo.text = self.caseDetailDic[@"slbm"];
            }
            if (i == 7) {
                inputInfo.text = self.caseDetailDic[@"ssbd"];
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
            }
            if (i == 8) {
                NSString *key = self.caseDetailDic[@"sffs"];
                NSString *tollMethod = self.tollMethod[key];
                inputInfo.text = tollMethod;
            }
            if (i == 9) {
                inputInfo.text = self.caseDetailDic[@"dlf"];
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
            }
            if (i == 10) {
                inputInfo.text = self.caseDetailDic[@"jzf"];
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
            }
            if (i == 11) {
                NSString *key = self.caseDetailDic[@"ssjd"];
                NSString *ssjd = self.ssjdDic[key];
                inputInfo.text = ssjd;
            }
            if (i == 12) {
                NSString *key = self.caseDetailDic[@"ssdw"];
                NSString *ssdw = self.ssdwDic[key];
                inputInfo.text = ssdw;
            }
            if (i == 13) {
                inputInfo.text = self.caseDetailDic[@""];
            }
            if (i == 14) {
                inputInfo.text = self.caseDetailDic[@"bzsm"];
            }

            if (i == 0 || i == 8 || i == 11 || i == 12 || i == 13 ) {
                button_textFiled.hidden = NO;
            }
            else if (i == 3){
                inputInfo.keyboardType = UIKeyboardTypePhonePad;
                button_textFiled.hidden = YES;
            }
            else{
                if (i == 7 || i == 9 || i == 10){
                    inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                }
                button_textFiled.hidden = YES;
            }
            
        }
        if (self.flag == 2) {
            scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT + 450);
            inputInfo.tag = i + 200;
            button_textFiled.tag = i + 200;
            if (i == 0) {
                inputInfo.text = self.caseDetailDic[@"sarq"];
            }
            if (i == 1) {
                inputInfo.text = self.caseDetailDic[@"ay"];
            }
            if (i == 2) {
                inputInfo.text = self.caseDetailDic[@"wtr"];
            }
            if (i == 3) {
                inputInfo.text = self.caseDetailDic[@"tel"];
            }
            if (i == 4) {
                inputInfo.text = self.caseDetailDic[@"dsr"];
            }
            if (i == 5) {
                inputInfo.text = self.caseDetailDic[@"dfdsr"];
            }
            if (i == 6) {
                inputInfo.text = self.caseDetailDic[@"slbm"];
            }
            if (i == 7) {
                inputInfo.text = self.caseDetailDic[@"ssbd"];
            }
            if (i == 8) {
                NSString *key = self.caseDetailDic[@"sffs"];
                NSString *tollMethod = self.tollMethod[key];
                inputInfo.text = tollMethod;
            }
            if (i == 9) {
                inputInfo.text = self.caseDetailDic[@"dlf"];
            }
            if (i == 10) {
                inputInfo.text = self.caseDetailDic[@"jzf"];
            }
            if (i == 11) {
                NSString *key = self.caseDetailDic[@"ssjd"];
                NSString *ssjd = self.ssjdDic[key];
                inputInfo.text = ssjd;
            }
            if (i == 12) {
                NSString *key = self.caseDetailDic[@"ssdw"];
                NSString *ssdw = self.ssdwDic[key];
                inputInfo.text = ssdw;
            }
            if (i == 13) {
                inputInfo.text = self.caseDetailDic[@"police"];
            }
            if (i == 14) {
                inputInfo.text = self.caseDetailDic[@"procuratorate"];
            }
            if (i == 15) {
                inputInfo.text = self.caseDetailDic[@"court"];
            }
            if (i == 16) {
                inputInfo.text = self.caseDetailDic[@"detention"];
            }
            if (i == 17) {
                inputInfo.text = self.caseDetailDic[@""];
            }
            if (i == 18) {
                inputInfo.text = self.caseDetailDic[@"bzsm"];
            }
            if (i == 0 || i == 8 || i == 11 || i == 12 || i == 17 ) {
                button_textFiled.hidden = NO;
            }
            else{
                if (i == 3 || i == 7 || i == 9 || i == 10){
                    inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                }

                button_textFiled.hidden = YES;
            }
            
        }
        if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
            scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT + 180);
            inputInfo.tag = i + 400;
            button_textFiled.tag = i + 400;
            if (i == 0) {
                inputInfo.text = self.caseDetailDic[@"sarq"];
            }
            if (i == 1) {
                inputInfo.text = self.caseDetailDic[@"ay"];
            }
            if (i == 2) {
                inputInfo.text = self.caseDetailDic[@"wtr"];
            }
            if (i == 3) {
                inputInfo.text = self.caseDetailDic[@"tel"];
            }
            if (i == 4) {
                inputInfo.text = self.caseDetailDic[@"dsr"];
            }
            if (i == 5) {
                inputInfo.text = self.caseDetailDic[@"dfdsr"];
            }
            if (i == 6) {
                inputInfo.text = self.caseDetailDic[@"slbm"];
            }
            if (i == 7) {
                inputInfo.text = self.caseDetailDic[@"ssbd"];
            }
            if (i == 8) {
                NSString *key = self.caseDetailDic[@"sffs"];
                NSString *tollMethod = self.tollMethod[key];
                inputInfo.text = tollMethod;
            }
            if (i == 9) {
                inputInfo.text = self.caseDetailDic[@"dlf"];
            }
            if (i == 10) {
                inputInfo.text = self.caseDetailDic[@"jzf"];
            }
            if (i == 11) {
                inputInfo.text = self.caseDetailDic[@"badq"];
            }
            if (i == 12) {
                inputInfo.text = self.caseDetailDic[@"bzsm"];
            }

            if (i == 0 || i == 8 || i == 11) {
                button_textFiled.hidden = NO;
            }
            else{
                if (i == 3 || i == 7 || i == 9 || i == 10){
                    inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                }
                button_textFiled.hidden = YES;
            }
            
        }
        if (self.flag == 8) {
            scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT + 200);
            inputInfo.tag = i + 800;
            button_textFiled.tag = i + 800;
            if (i == 0) {
                inputInfo.text = self.caseDetailDic[@"sarq"];
            }
            if (i == 1) {
                inputInfo.text = self.caseDetailDic[@"ay"];
            }
            if (i == 2) {
                inputInfo.text = self.caseDetailDic[@"wtr"];
            }
            if (i == 3) {
                inputInfo.text = self.caseDetailDic[@"tel"];
            }
            if (i == 4) {
                inputInfo.text = self.caseDetailDic[@"dsr"];
            }
            if (i == 4) {
                inputInfo.text = self.caseDetailDic[@"dfdsr"];
            }
            if (i == 5) {
                inputInfo.text = self.caseDetailDic[@"slbm"];
            }
            if (i == 6) {
                inputInfo.text = self.caseDetailDic[@"ssbd"];
            }
            if (i == 7) {
                NSString *key = self.caseDetailDic[@"sffs"];
                NSString *tollMethod = self.tollMethod[key];
                inputInfo.text = tollMethod;            }
            if (i == 8) {
                inputInfo.text = self.caseDetailDic[@"dlf"];
            }
            if (i == 10) {
                inputInfo.text = self.caseDetailDic[@"jzf"];
            }
            if (i == 11) {
                NSString *key = self.caseDetailDic[@"ssdw"];
                NSString *ssdw = self.ssdwDic[key];
                inputInfo.text = ssdw;
            }
            if (i == 12) {
                inputInfo.text = self.caseDetailDic[@""];
            }
            if (i == 13) {
                inputInfo.text = self.caseDetailDic[@"bzsm"];
            }

            if (i == 0 || i == 8 || i == 11 || i == 12) {
                button_textFiled.hidden = NO;
            }
            else{
                if (i == 3 || i == 7 || i == 9 || i == 10){
                    inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                }
                button_textFiled.hidden = YES;
            }
            
        }
        
        UIImageView *titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
        titleImage.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        titleImage.image = [UIImage imageNamed:self.imageArray[i]];
        
        if (i == self.titleArray.count - 1) {
            UIButton *putInButton = [UIButton buttonWithType:UIButtonTypeCustom];
            putInButton.frame = CGRectMake(20, 120 + (i + 1) * 50, self.view.bounds.size.width - 40, 40);
            [putInButton setTitle:@"确认提交" forState:UIControlStateNormal];
            putInButton.titleLabel.textColor = [UIColor whiteColor];
            putInButton.layer.cornerRadius = 5;
            putInButton.layer.masksToBounds = YES;
            putInButton.backgroundColor = [UIColor colorWithRed:33.0f/255.0f green:180.0f/255.0f blue:237.0f/255.0f alpha:1.0f];
            [putInButton addTarget:self action:@selector(action_PutIn) forControlEvents:UIControlEventTouchUpInside];
            [backView addSubview:putInButton];
        }
        [bgView addSubview:titleImage];
        [backView addSubview:inputInfo];
        [backView addSubview:button_textFiled];
        [bgView insertSubview:view belowSubview:titleImage];
        
        
    }
    
    
}
#pragma mark - Button Target
- (void)action_PutIn{
    
    if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
        UITextField *textField = [self.view viewWithTag:100];
        UITextField *textField1 = [self.view viewWithTag:101];
        UITextField *textField2 = [self.view viewWithTag:102];
        UITextField *textField3 = [self.view viewWithTag:103];
        UITextField *textField4 = [self.view viewWithTag:104];
        UITextField *textField5 = [self.view viewWithTag:105];
        UITextField *textField6 = [self.view viewWithTag:106];
        UITextField *textField7 = [self.view viewWithTag:107];
        UITextField *textField8 = [self.view viewWithTag:108];
        UITextField *textField9 = [self.view viewWithTag:109];
        UITextField *textField10 = [self.view viewWithTag:110];
        UITextField *textField11 = [self.view viewWithTag:111];
        UITextField *textField12 = [self.view viewWithTag:112];
        UITextField *textField13 = [self.view viewWithTag:113];
        UITextField *textField14 = [self.view viewWithTag:114];
        
        if (textField.tag == 100 && textField.text.length == 0) {
            NSLog(@"收案日期不为空 ");
            [MBProgressHUD showError:@"请填写收案日期"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 101 && textField1.text.length == 0){
            NSLog(@"案由不为空");
            [MBProgressHUD showError:@"请填写案由"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 102 && textField2.text.length == 0){
            NSLog(@"委托人不为空");
            [MBProgressHUD showError:@"请填写委托人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField3.tag == 103 && textField3.text.length > 0 && ![PhoneNumberFormat validateCellPhoneNumber:textField3.text]){
            NSLog(@"请检查电话号码格式");
            [MBProgressHUD showError:@"请检查电话号码格式"];
            return;
        }
        if (textField5.tag == 105 && textField5.text.length == 0) {
            NSLog(@"对方当事人不为空");
            [MBProgressHUD showError:@"请填写对方当事人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField7.tag == 107 && textField7.text.length == 0) {
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField9.tag == 109 && textField9.text.length == 0) {
            NSLog(@"代理费不为空");
            [MBProgressHUD showError:@"请填写代理费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField10.tag == 110 && textField10.text.length == 0) {
            NSLog(@"杂费不为空");
            [MBProgressHUD showError:@"请填写杂费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        NSLog(@"发起申请");
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        
//        NSDictionary *dic = @{@"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],@"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl]};
//        [NetworkingManager getUrl:[NSString stringWithFormat:@"%@companyId=%@",GETCASENUMBER_URL,[InfoSingleTon personInfoSingleTon].infoDic[@"cid"]] dic:dic Succeed:^(id responseData) {
//            self.caseNumber = responseData[@"caseNo"];
            NSDictionary *dic2 = @{
//                                   @"ah_number":self.caseNumber,
                                   
                                   @"ah_number":self.caseDetailDic[@"ah_number"],
                                   
                                   @"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl],
                                   
                                   @"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],
                                   
                                   @"sarq":textField.text,
                                   
                                   @"ay":textField1.text,
                                   
                                   @"wtr":textField2.text,
                                   
                                   @"tel":textField3.text,
                                   
                                   @"dsr":textField4.text,
                                   
                                   @"dfdsr":textField5.text,
                                   
                                   @"slbm":textField6.text,
                                   
                                   @"ssbd":textField7.text,
                                   
                                   @"sffs":textField8.text,
                                   
                                   @"dlf":textField9.text,
                                   
                                   @"jzf":textField10.text,
                                   
                                   @"ssjd":textField11.text,
                                   
                                   @"ssdw":textField12.text,
                                   
                                   @"badq":textField13.text,
                                   
                                   @"bzsm":textField14.text,
                                   
                                   @"id":self.caseDetailDic[@"id"],
                                   
                                   @"company_id":[InfoSingleTon personInfoSingleTon].infoDic[@"cid"],
                                   
                                   @"create_id":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"id"],
                                   
                                   @"create_time":@"2017-07-18",
                                   
                                   
                                   };
            self.postDic = dic2;
            
            [self alterCase];
            
//        } failure:^(NSError *error) {
//            [MBProgressHUD showError:@"请求失败"];
//            [MBProgressHUD hideHUDForView:self.view animated:YES];
//        }];
    }
    
    if (self.flag == 2) {
        UITextField *textField = [self.view viewWithTag:200];
        UITextField *textField1 = [self.view viewWithTag:201];
        UITextField *textField2 = [self.view viewWithTag:202];
        UITextField *textField3 = [self.view viewWithTag:203];
        UITextField *textField4 = [self.view viewWithTag:204];
        UITextField *textField5 = [self.view viewWithTag:205];
        UITextField *textField6 = [self.view viewWithTag:206];
        UITextField *textField7 = [self.view viewWithTag:207];
        UITextField *textField8 = [self.view viewWithTag:208];
        UITextField *textField9 = [self.view viewWithTag:209];
        UITextField *textField10 = [self.view viewWithTag:210];
        UITextField *textField11 = [self.view viewWithTag:211];
        UITextField *textField12 = [self.view viewWithTag:212];
        UITextField *textField13 = [self.view viewWithTag:213];
        UITextField *textField14 = [self.view viewWithTag:214];
        UITextField *textField15 = [self.view viewWithTag:215];
        UITextField *textField16 = [self.view viewWithTag:216];
        UITextField *textField17 = [self.view viewWithTag:217];
        UITextField *textField18 = [self.view viewWithTag:218];
        
        if (textField.tag == 200 && textField.text.length == 0) {
            NSLog(@"收案日期不为空 ");
            [MBProgressHUD showError:@"请填写收案日期"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 201 && textField1.text.length == 0){
            NSLog(@"案由不为空");
            [MBProgressHUD showError:@"请填写案由"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 202 && textField2.text.length == 0){
            NSLog(@"委托人不为空");
            [MBProgressHUD showError:@"请填写委托人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField3.tag == 203 && textField3.text.length > 0 && ![PhoneNumberFormat validateCellPhoneNumber:textField3.text]){
            NSLog(@"请检查电话号码格式");
            [MBProgressHUD showError:@"请检查电话号码格式"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField5.tag == 205 && textField5.text.length == 0) {
            NSLog(@"对方当事人不为空");
            [MBProgressHUD showError:@"请填写对方当事人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField7.tag == 207 && textField7.text.length == 0) {
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField9.tag == 209 && textField9.text.length == 0) {
            NSLog(@"代理费不为空");
            [MBProgressHUD showError:@"请填写代理费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField10.tag == 210 && textField10.text.length == 0) {
            NSLog(@"杂费不为空");
            [MBProgressHUD showError:@"请填写杂费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        NSLog(@"发起申请");
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        
//        NSDictionary *dic = @{@"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],@"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl]};
//        [NetworkingManager getUrl:[NSString stringWithFormat:@"%@companyId=%@",GETCASENUMBER_URL,[InfoSingleTon personInfoSingleTon].infoDic[@"cid"]] dic:dic Succeed:^(id responseData) {
//            self.caseNumber = responseData[@"caseNo"];
            NSDictionary *dic2 = @{
                                   @"ah_number":self.caseDetailDic[@"ah_number"],
                                   
                                   @"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl],
                                   
                                   @"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],
                                   
                                   @"sarq":textField.text,
                                   
                                   @"ay":textField1.text,
                                   
                                   @"wtr":textField2.text,
                                   
                                   @"tel":textField3.text,
                                   
                                   @"dsr":textField4.text,
                                   
                                   @"dfdsr":textField5.text,
                                   
                                   @"slbm":textField6.text,
                                   
                                   @"ssbd":textField7.text,
                                   
                                   @"sffs":textField8,
                                   
                                   @"dlf":textField9.text,
                                   
                                   @"jzf":textField10.text,
                                   
                                   @"ssjd":textField11.text,
                                   
                                   @"ssdw":textField12,
                                   
                                   @"police":textField13.text,
                                   
                                   @"procuratorate":textField14.text,
                                   
                                   @"court":textField15.text,
                                   
                                   @"detention":textField16.text,
                                   
                                   
                                   @"badq":textField17.text,
                                   
                                   @"bzsm":textField18.text,
                                   
                                   @"id":self.caseDetailDic[@"id"],
                                   
                                   @"company_id":[InfoSingleTon personInfoSingleTon].infoDic[@"cid"],
                                   
                                   @"create_id":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"id"],
                                   
                                   //                              @"create_name":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"name"],
                                   
                                   @"create_time":@"2017-07-18",
                                   
                                   
                                   };
            self.postDic = dic2;
            [self alterCase];
            
//        } failure:^(NSError *error) {
//            [MBProgressHUD showError:@"请求失败"];
//            [MBProgressHUD hideHUDForView:self.view animated:YES];
//        }];
    }
    
    if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
        UITextField *textField = [self.view viewWithTag:400];
        UITextField *textField1 = [self.view viewWithTag:401];
        UITextField *textField2 = [self.view viewWithTag:402];
        UITextField *textField3 = [self.view viewWithTag:403];
        UITextField *textField4 = [self.view viewWithTag:404];
        UITextField *textField5 = [self.view viewWithTag:405];
        UITextField *textField6 = [self.view viewWithTag:406];
        UITextField *textField7 = [self.view viewWithTag:407];
        UITextField *textField8 = [self.view viewWithTag:408];
        UITextField *textField9 = [self.view viewWithTag:409];
        UITextField *textField10 = [self.view viewWithTag:410];
        UITextField *textField11 = [self.view viewWithTag:411];
        UITextField *textField12 = [self.view viewWithTag:412];
        
        if (textField.tag == 400 && textField.text.length == 0) {
            NSLog(@"收案日期不为空 ");
            [MBProgressHUD showError:@"请填写收案日期"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 401 && textField1.text.length == 0){
            NSLog(@"案由不为空");
            [MBProgressHUD showError:@"请填写案由"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 402 && textField2.text.length == 0){
            NSLog(@"委托人不为空");
            [MBProgressHUD showError:@"请填写委托人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField3.tag == 403 && textField3.text.length > 0 && ![PhoneNumberFormat validateCellPhoneNumber:textField3.text]){
            NSLog(@"请检查电话号码格式");
            [MBProgressHUD showError:@"请检查电话号码格式"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField5.tag == 405 && textField5.text.length == 0) {
            NSLog(@"对方当事人不为空");
            [MBProgressHUD showError:@"请填写对方当事人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField7.tag == 407 && textField7.text.length == 0) {
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField9.tag == 409 && textField9.text.length == 0) {
            NSLog(@"代理费不为空");
            [MBProgressHUD showError:@"请填写代理费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField10.tag == 410 && textField10.text.length == 0) {
            NSLog(@"杂费不为空");
            [MBProgressHUD showError:@"请填写杂费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }

        NSLog(@"发起申请");
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        
//        NSDictionary *dic = @{@"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],@"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl]};
//        [NetworkingManager getUrl:[NSString stringWithFormat:@"%@companyId=%@",GETCASENUMBER_URL,[InfoSingleTon personInfoSingleTon].infoDic[@"cid"]] dic:dic Succeed:^(id responseData) {
//            self.caseNumber = responseData[@"caseNo"];
            NSDictionary *dic2 = @{
                                   @"ah_number":self.caseDetailDic[@"ah_number"],
                                   
                                   @"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl],
                                   
                                   @"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],
                                   
                                   @"sarq":textField.text,
                                   
                                   @"ay":textField1.text,
                                   
                                   @"wtr":textField2.text,
                                   
                                   @"tel":textField3.text,
                                   
                                   @"dsr":textField4.text,
                                   
                                   @"dfdsr":textField5.text,
                                   
                                   @"slbm":textField6.text,
                                   
                                   @"ssbd":textField7.text,
                                   
                                   @"sffs":textField8,
                                   
                                   @"dlf":textField9.text,
                                   
                                   @"jzf":textField10.text,
                                   
                                   @"badq":textField11.text,
                                   
                                   @"bzsm":textField12.text,
                                   
                                   @"id":self.caseDetailDic[@"id"],
                                   
                                   @"company_id":[InfoSingleTon personInfoSingleTon].infoDic[@"cid"],
                                   
                                   @"create_id":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"id"],
                                   
                                   //                              @"create_name":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"name"],
                                   
                                   
                                   @"create_time":@"2017-07-18",
                                   
                                   
                                   };
            self.postDic = dic2;
            [self alterCase];
            
//        } failure:^(NSError *error) {
//            [MBProgressHUD showError:@"请求失败"];
//            [MBProgressHUD hideHUDForView:self.view animated:YES];
//        }];
    }
    
    if (self.flag == 8) {
        UITextField *textField = [self.view viewWithTag:800];
        UITextField *textField1 = [self.view viewWithTag:801];
        UITextField *textField2 = [self.view viewWithTag:802];
        UITextField *textField3 = [self.view viewWithTag:803];
        UITextField *textField4 = [self.view viewWithTag:804];
        UITextField *textField5 = [self.view viewWithTag:805];
        UITextField *textField6 = [self.view viewWithTag:806];
        UITextField *textField7 = [self.view viewWithTag:807];
        UITextField *textField8 = [self.view viewWithTag:808];
        UITextField *textField9 = [self.view viewWithTag:809];
        UITextField *textField10 = [self.view viewWithTag:810];
        UITextField *textField11 = [self.view viewWithTag:811];
        UITextField *textField12 = [self.view viewWithTag:812];
        UITextField *textField13 = [self.view viewWithTag:813];
        
        if (textField.tag == 800 && textField.text.length == 0) {
            NSLog(@"收案日期不为空 ");
            [MBProgressHUD showError:@"请填写收案日期"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 801 && textField1.text.length == 0){
            NSLog(@"案由不为空");
            [MBProgressHUD showError:@"请填写案由"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 802 && textField2.text.length == 0){
            NSLog(@"委托人不为空");
            [MBProgressHUD showError:@"请填写委托人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField3.tag == 803 && textField3.text.length > 0 && ![PhoneNumberFormat validateCellPhoneNumber:textField3.text]){
            NSLog(@"请检查电话号码格式");
            [MBProgressHUD showError:@"请检查电话号码格式"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField5.tag == 805 && textField5.text.length == 0) {
            NSLog(@"对方当事人不为空");
            [MBProgressHUD showError:@"请填写对方当事人"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField7.tag == 807 && textField7.text.length == 0) {
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField9.tag == 809 && textField9.text.length == 0) {
            NSLog(@"代理费不为空");
            [MBProgressHUD showError:@"请填写代理费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField10.tag == 810 && textField10.text.length == 0) {
            NSLog(@"杂费不为空");
            [MBProgressHUD showError:@"请填写杂费"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        NSLog(@"发起申请");
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        
//        NSDictionary *dic = @{@"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],@"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl]};
//        [NetworkingManager getUrl:[NSString stringWithFormat:@"%@companyId=%@",GETCASENUMBER_URL,[InfoSingleTon personInfoSingleTon].infoDic[@"cid"]] dic:dic Succeed:^(id responseData) {
//            self.caseNumber = responseData[@"caseNo"];
            NSDictionary *dic2 = @{
                                   @"ah_number":self.caseDetailDic[@"ah_number"],
                                   
                                   @"ajfl":[NSString stringWithFormat:@"%ld",self.ajfl],
                                   
                                   @"ajlx":[NSString stringWithFormat:@"%ld",self.ajlx],
                                   
                                   @"sarq":textField.text,
                                   
                                   @"ay":textField1.text,
                                   
                                   @"wtr":textField2.text,
                                   
                                   @"tel":textField3.text,
                                   
                                   @"dsr":textField4.text,
                                   
                                   @"dfdsr":textField5.text,
                                   
                                   @"slbm":textField6.text,
                                   
                                   @"ssbd":textField7.text,
                                   
                                   @"sffs":textField8,
                                   
                                   @"dlf":textField9.text,
                                   
                                   @"jzf":textField10.text,
                                   
                                   @"ssdw":textField11,
                                   
                                   @"badq":textField12.text,
                                   
                                   @"bzsm":textField13.text,
                                   
                                   @"id":self.caseDetailDic[@"id"],
                                   
                                   @"company_id":[InfoSingleTon personInfoSingleTon].infoDic[@"cid"],
                                   
                                   @"create_id":[InfoSingleTon personInfoSingleTon].infoDic[@"user"][@"id"],
                                   
                                   @"create_time":@"2017-07-18",
                                   
                                   
                                   };
            self.postDic = dic2;
            
            [self alterCase];
            
//        } failure:^(NSError *error) {
//            [MBProgressHUD showError:@"请求失败"];
//            [MBProgressHUD hideHUDForView:self.view animated:YES];
//        }];
    }
    
}

#pragma mark - Method

- (void)alterCase{
    [NetworkingManager postUrl:ALTERCASE_URL dic:self.postDic Succeed:^(id responseData) {
        
        NSLog(@"addJobLog :%@",responseData);
        NSLog(@"%@",responseData);
        [MBProgressHUD showError:@"上传成功"];
        [MBProgressHUD hideHUDForView:self.view animated:YES];
        [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1]
                                              animated:YES];
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        [MBProgressHUD showError:@"上传失败"];
        [MBProgressHUD hideHUDForView:self.view animated:YES];
    }];
}
- (void)textFieldsDidClick:(UIButton *)sender{
    //    if (self.flag == 0) {
    NSLog(@"tag = %ld",sender.tag);
    if (sender.tag == 100) {
        self.seletTag = 100;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = DeteArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 108) {
        self.seletTag = 108;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"免费",@"计件收费",@"按标的比例收费",@"风险代理收费",@"固定+风险代理收费"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 111) {
        self.seletTag = 111;
        JHPickView *picker = [[JHPickView alloc] initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"调查取证",@"一审",@"二审",@"执行",@"再审"];
        [self.view addSubview:picker];
    }
    
    if (sender.tag == 112) {
        self.seletTag = 112;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"原告",@"被告",@"上诉人",@"被上诉人",@"申请执行人",@"被申请执行人",@"申请人",@"被申请人",@"第三人",@"其他"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 113) {
        self.seletTag = 113;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = AreaArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 200) {
        self.seletTag = 200;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = DeteArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 208) {
        self.seletTag = 208;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"免费",@"计件收费",@"按标的比例收费",@"风险代理收费",@"固定+风险代理收费"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 211) {
        self.seletTag = 211;
        JHPickView *picker = [[JHPickView alloc] initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"侦查阶段",@"审查起诉",@"一审审理",@"二审审理",@"死刑复核",@"再审"];
        [self.view addSubview:picker];
    }
    
    if (sender.tag == 212) {
        self.seletTag = 212;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"原告人",@"犯罪嫌疑人",@"被告人/附带民事诉讼被告人",@"上诉人",@"被上诉人",@"自诉人",@"申诉人",@"被害人",@"其他"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 217) {
        self.seletTag = 217;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = AreaArray;
        [self.view addSubview:picker];
    }if (sender.tag == 400) {
        self.seletTag = 400;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = DeteArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 408) {
        self.seletTag = 408;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"免费",@"计件收费",@"按标的比例收费",@"风险代理收费",@"固定+风险代理收费"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 411) {
        self.seletTag = 411;
        JHPickView *picker = [[JHPickView alloc] initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = AreaArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 800) {
        self.seletTag = 800;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = DeteArray;
        [self.view addSubview:picker];
    }
    if (sender.tag == 808) {
        self.seletTag = 808;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"免费",@"计件收费",@"按标的比例收费",@"风险代理收费",@"固定+风险代理收费"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 811) {
        self.seletTag = 811;
        JHPickView *picker = [[JHPickView alloc] initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"申述人",@"被申述人"];
        [self.view addSubview:picker];
    }
    
    if (sender.tag == 812) {
        self.seletTag = 812;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.arrayType = AreaArray;
        [self.view addSubview:picker];
    }
    
    
}

#pragma mark - UITextFiledDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    
    /*
     *  判断输入是否为小数
     */
    //     判断是否有小数点
    NSLog(@"tex = %@  ns = %@  让 = %ld",textField.text,string,range.location);
    if ([textField.text containsString:@"."])
    {
        isHaveDian = YES;
    }else{
        isHaveDian = NO;
        
    } if (string.length > 0) {
        //当前输入的字符
        unichar single = [string characterAtIndex:0];
        NSLog(@"single = %c",single);
        
        // 不能输入.0-9以外的字符
//        if (!((single >= '0' && single <= '9') || single == '.')) {
//            [self showMyMessage:@"您的输入格式不正确" ];
//            return NO;
//        }
        
        // 只能有一个小数点
        if (isHaveDian && single == '.') {
            [self showMyMessage:@"最多只能输入一个小数点" ];
            return NO;
        }
        // 如果第一位是.则前面加上0.
        if ((textField.text.length == 0) && (single == '.')) {
            
            textField.text = @"0";
        }
        
        // 如果第一位是0则后面必须输入点，否则不能输入。
        if ([textField.text hasPrefix:@"0"]) {
            
            NSLog(@"tex = %@  ns = %@",textField.text,string);
            //            textField.text = @".";
            if (textField.text.length > 1) {
                NSString *secondStr = [textField.text substringWithRange:NSMakeRange(1, 1)];
                if (![secondStr isEqualToString:@"."]) {
                    [self showMyMessage:@"第二个字符需要是小数点" ];
                    return NO;
                }
            }else{
                if (![string isEqualToString:@"."]) {
                    [self showMyMessage:@"第二个字符需要是小数点" ];
                    return NO;
                }
            }
        }
        // 小数点后最多能输入两位
        if (isHaveDian) {
            NSRange ran = [textField.text rangeOfString:@"."];
            // 由于range.location是NSUInteger类型的，所以这里不能通过(range.location - ran.location)>2来判断
            if (range.location > ran.location) {
                if ([textField.text pathExtension].length > 1) {
                    [self showMyMessage:@"小数点后最多有两位小数" ];
                    return NO;
                }
            }
        }
    }
    
    return YES;
}

-(void)showMyMessage:(NSString*)aInfo {
    
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:aInfo delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    
    [alertView show];
    
}
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
    
    if (textField.tag == 100 || textField.tag == 108 || textField.tag == 111 || textField.tag == 112 || textField.tag == 113 || textField.tag == 200 || textField.tag == 208 || textField.tag == 211 || textField.tag == 212 || textField.tag == 217 || textField.tag == 400 || textField.tag == 408 || textField.tag == 411 || textField.tag == 800 || textField.tag == 808 || textField.tag == 811 || textField.tag == 812) {
        return NO;
    }
    else{
        return YES;
    }
    
}

#pragma mark - JHPickerViewDelegate
-(void)PickerSelectorIndixString:(NSString *)str
{
    UITextField *textfield = [self.view viewWithTag:self.seletTag];
    textfield.text = str;
}
#pragma mark - Getter
- (NSDictionary *)log_Type{
    if (!_log_Type) {
        _log_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"客户拜访",@"2",@"商务谈判",@"3",@"法律咨询",@"4",@"案例/资料检索",@"5",@"法律文书起草/修改",@"6",@"调查取证",@"7",@"案件研讨",@"8",@"刑案律师会见",@"9",@"诉讼/仲裁出庭",@"10",@"信访/社区/法援律师值班", nil];
    }
    return _log_Type;
}
- (NSDictionary *)charge_Type{
    if (!_charge_Type) {
        _charge_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"预收款",@"2",@"追加费用",@"3",@"尾款",@"4",@"退款", nil];
    }
    return _charge_Type;
}
- (NSDictionary *)pay_Type{
    if (!_pay_Type) {
        _pay_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"现金",@"2",@"刷卡", nil];
    }
    return _pay_Type;
}
- (NSDictionary *)tollMethod{
    if (!_tollMethod) {
        _tollMethod = [NSDictionary dictionaryWithObjectsAndKeys:@"免费",@"0",@"计件收费",@"1",@"按标的比例收费",@"2",@"风险代理收费",@"3",@"固定+风险代理收费",@"4", nil];
    }
    return _tollMethod;
}
- (NSDictionary *)ssjdDic{
    if (!_ssjdDic) {
        _ssjdDic = [NSDictionary dictionaryWithObjectsAndKeys:@"调查取证",@"0",@"一审",@"1",@"二审",@"2",@"执行",@"3",@"再审",@"4", nil];
    }
    return _ssjdDic;
}
- (NSDictionary *)ssdwDic{
    if (!_ssdwDic) {
        _ssdwDic = [NSDictionary dictionaryWithObjectsAndKeys:@"原告",@"0",@"被告",@"1",@"上诉人",@"2",@"被上诉人",@"3",@"申请执行人",@"4",@"被申请执行人",@"5", @"申请人",@"6",@"被申请人",@"7",@"第三人",@"8",@"其他",@"9", nil];
    }
    return _ssdwDic;
}
- (NSArray *)titleArray{
    if (!_titleArray) {
        if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
            _titleArray = [NSArray arrayWithObjects:@"收 案 日 期  ：",@"案            由 ：",@"委    托    人 ：",@"联 系 电 话： ",@"当    事    人 ：",@"对方当事人  ：",@"受 理 部 门  ：",@"诉 讼 标 的  ：",@"收 费 方 式  ：",@"代    理    费 ：",@"杂            费 ：",@"诉 讼 阶 段  ：",@"诉 讼 地 位  ：",@"办 案 地 区  ：",@"案 件 备 注  ：",nil];
        }
        if (self.flag == 2) {
            _titleArray = [NSArray arrayWithObjects:@"收 案 日 期  ：",@"案            由 ：",@"委    托    人 ：",@"联 系 电 话： ",@"当    事    人 ：",@"对方当事人  ：",@"受 理 部 门  ：",@"诉 讼 标 的  ：",@"收 费 方 式  ：",@"代    理    费 ：",@"杂            费 ：",@"诉 讼 阶 段  ：",@"诉 讼 地 位  ：",@"公           安  ：",@"检    察    院  ：",@"法           院  ：",@"看    守    所：",@"办 案 地 区  ：",@"案 件 备 注  ：",nil];
        }
        if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
            _titleArray = [NSArray arrayWithObjects:@"收 案 日 期  ：",@"案            由 ：",@"委    托    人 ：",@"联 系 电 话： ",@"当    事    人 ：",@"对方当事人  ：",@"受 理 部 门  ：",@"诉 讼 标 的  ：",@"收 费 方 式  ：",@"代    理    费 ：",@"杂            费 ：",@"办 案 地 区  ：",@"案 件 备 注  ：",nil];
        }
        if (self.flag == 8) {
            _titleArray = [NSArray arrayWithObjects:@"收 案 日 期  ：",@"案            由 ：",@"委    托    人 ：",@"联 系 电 话： ",@"当    事    人 ：",@"对方当事人  ：",@"受 理 部 门  ：",@"诉 讼 标 的  ：",@"收 费 方 式  ：",@"代    理    费 ：",@"杂            费 ：",@"诉 讼 地 位  ：",@"办 案 地 区  ：",@"案 件 备 注  ：",nil];
        }
        //        if (self.flag == 10) {
        //            _titleArray = [NSArray arrayWithObjects:@"服 务 类 型  ：",@"服 务 时 间  ：",@"服 务 人 数  ：",@"服 务 费 用  ：",@"委    托    人 ：",@"备 注 说 明  ：",nil];
        //        }
    }
    return _titleArray;
}
- (NSArray *)imageArray{
    if (!_imageArray) {
        if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",@"llist_0",@"llist_02",@"llist_02",@"llist_05",@"llist_06",@"llist_07",@"llist_08",@"llist_09",@"llist_010",@"llist_011",@"llist_012",@"llist_012", nil];
        }
        if (self.flag == 2) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",@"llist_0",@"llist_05",@"llist_06",@"llist_07",@"llist_08",@"llist_02",@"llist_03",@"llist_09",@"llist_010",@"llist_011",@"llist_012",@"llist_012",@"llist_012",@"llist_012",@"llist_012",@"llist_012", nil];
        }
        if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_02",@"llist_03",@"llist_03",@"llist_0",@"llist_05",@"llist_06",@"llist_07",@"llist_08",@"llist_09",@"llist_012",@"llist_012", nil];
        }
        if (self.flag == 8) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",@"llist_02",@"llist_03",@"llist_0",@"llist_05",@"llist_06",@"llist_07",@"llist_08",@"llist_09",@"llist_011",@"llist_012",@"llist_012", nil];
        }
        //        if (self.flag == 10) {
        //            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",@"llist_0",@"llist_05",@"llist_06", nil];
        //        }
    }
    return _imageArray;
}


- (NSArray *)placeHolderArray{
    if (!_placeHolderArray) {
        if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择收案日期",@"请填写案由",@"请填写委托人",@"请填写委联系电话",@"请填写当事人",@"请填写对方当事人",@"请填写受理部门",@"请填写诉讼标的",@"请选择收费方式",@"请填写代理费",@"请填写杂费",@"请选择诉讼阶段",@"请选择诉讼地位",@"请选择办案地区",@"请填写案件备注", nil];
        }
        
        if (self.flag == 2) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择收案日期",@"请填写案由",@"请填写委托人",@"请填写委联系电话",@"请填写当事人",@"请填写对方当事人",@"请填写受理部门",@"请填写诉讼标的",@"请选择收费方式",@"请填写代理费",@"请填写杂费",@"请选择诉讼阶段",@"请选择诉讼地位",@"请填写",@"请填写",@"请填写",@"请填写",@"请选择办案地区",@"请填写案件备注", nil];
        }
        if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择收案日期",@"请填写案由",@"请填写委托人",@"请填写委联系电话",@"请填写当事人",@"请填写对方当事人",@"请填写受理部门",@"请填写诉讼标的",@"请选择收费方式",@"请填写代理费",@"请填写杂费",@"请选择办案地区",@"请填写案件备注", nil];
        }
        if (self.flag == 8) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择收案日期",@"请填写案由",@"请填写委托人",@"请填写委联系电话",@"请填写当事人",@"请填写对方当事人",@"请填写受理部门",@"请填写诉讼标的",@"请选择收费方式",@"请填写代理费",@"请填写杂费",@"请选择诉讼地位",@"请选择办案地区",@"请填写案件备注", nil];
        }
        //        if (self.flag == 10) {
        //            _placeHolderArray = [NSArray arrayWithObjects:@"口头法律咨询（人数）",@"请填写服务时间",@"请填写服务人数",@"请填写服务费用",@"请填写委托人",@"请填写备注", nil];
        //        }
    }
    return _placeHolderArray;
}
- (NSArray *)starArray{
    if (!_starArray) {
        if (self.flag == 1 || self.flag == 3 || self.flag == 6 || self.flag == 7) {
            _starArray = [NSArray arrayWithObjects:@"*",@"*",@"*",@"",@"",@"*",@"",@"*",@"",@"*",@"*",@"",@"",@"",@"",nil];
        }
        if (self.flag == 2) {
            _starArray = [NSArray arrayWithObjects:@"*",@"*",@"*",@"",@"",@"*",@"",@"*",@"",@"*",@"*",@"",@"",@"",@"",@"",@"",@"",@"",nil];
        }
        if (self.flag == 4 || self.flag == 5 || self.flag == 9) {
            _starArray = [NSArray arrayWithObjects:@"*",@"*",@"*",@"",@"",@"*",@"",@"*",@"",@"*",@"*",@"",@"",nil];
        }
        if (self.flag == 8) {
            _starArray = [NSArray arrayWithObjects:@"*",@"*",@"*",@"",@"",@"*",@"",@"*",@"",@"*",@"*",@"",@"",@"",nil];
        }
        //        if (self.flag == 10) {
        //            _starArray = [NSArray arrayWithObjects:@"*",@"*",@"*",@"*",@"*",@"",nil];
        //        }
    }
    return _starArray;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
